package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: liangyuanzhang
 * Date: 2025-1-10
 * Time: 12:56
 */
public  class Dog extends Animal{//到这不想再被其他类继承可以在这个类前加final --> 叫做密封
    static {
        System.out.println("static :: Dog{ }");
    }

    {
        System.out.println("实例代码块 Dog{ }");

    }

    public Dog(String name,int age){
        super(name,age);
        System.out.println("Dog()......");
    }

    public Dog(){
        super("haha",10);
    }

  /*  public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }*/

/*    public void eat(){
        System.out.println(this.name + " 正在吃饭......");
    }*/

    public void bark(){
        System.out.println(this.name + " 正在汪汪汪叫......");
    }

/*    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }*/
}
